package edu.washington.tcss360.burningpenguins.tests;

import static org.junit.Assert.*;

import java.util.Date;

import org.junit.Before;
import org.junit.Test;

import edu.washington.tcss360.burningpenguins.data.Conference;
import edu.washington.tcss360.burningpenguins.data.DataObject;


/**
 * This class Tests Category.
 * @author Rolando Sierra
 *@version 11/17/2013
 */
public class ConferenceTest 
{

	/** A conference object to use in tests */
	private DataObject my_conference;
	
	/** Sets up an object for the tests. */
	@Before
	public void setUp() throws Exception 
	{
		my_conference = new Conference();
	}

	/** Test setting and getting ID. */
	@Test
	public void testGetId() 
	{
		my_conference.setId(3);
		assertSame("Incorrect Id", my_conference.getId(), 3);
	}

	/** Test setting and getting Title. */
	@Test
	public void testGetTitle() 
	{
		((Conference) my_conference).setTitle("test");
		assertSame("Incorrect Title", ((Conference) my_conference).getTitle(), "test");
	}

	/** Test setting and getting Submission deadlines. */
	@Test
	public void testGetSubmitDeadline() 
	{
		Long x = new Long(123);
		Date testDate = new Date(x);
		((Conference) my_conference).setSubmitDeadline(testDate);
		assertSame("Incorrect Date", ((Conference) my_conference).getSubmitDeadline(), testDate.getTime());
	}
	
	/** Test setting and getting review deadlines. */
	@Test
	public void testGetReviewDeadline() 
	{
		Long x = new Long(123);
		Date testDate = new Date(x);
		((Conference) my_conference).setReviewDeadline(testDate);
		assertSame("Incorrect Date", ((Conference) my_conference).getReviewDeadline(), testDate.getTime());
	}

	/** Test setting and getting recommended deadline. */
	@Test
	public void testGetRecommendDeadline() 
	{
		Long x = new Long(123);
		Date testDate = new Date(x);
		((Conference) my_conference).setRecommendDeadline(testDate);
		assertSame("Incorrect Date", ((Conference) my_conference).getRecommendDeadline(), testDate.getTime());
	}

	/** Test setting and getting accept deadline */
	@Test
	public void testGetAcceptDeadline() 
	{
		Long x = new Long(123);
		Date testDate = new Date(x);
		((Conference) my_conference).setAcceptDeadline(testDate);
		assertSame("Incorrect Date", ((Conference) my_conference).getAcceptDeadline(), testDate.getTime());
	}

	/** Test setting and getting update deadline. */
	@Test
	public void testGetUpdateDeadline() 
	{
		Long x = new Long(123);
		Date testDate = new Date(x);
		((Conference) my_conference).setUpdateDeadline(testDate);
		assertSame("Incorrect Date", ((Conference) my_conference).getUpdateDeadline(), testDate.getTime());
	}

}
